//
//  TT_GDMapManager.h
//  BaseProject
//
//  Created by 王洋 on 2020/4/8.
//  Copyright © 2020 王洋. All rights reserved.
//

#import <Foundation/Foundation.h>


//定位基础类
#import <AMapLocationKit/AMapLocationKit.h>


#import <CoreLocation/CoreLocation.h>

//搜索基础类
#import <AMapSearchKit/AMapSearchKit.h>


#import <AMapNaviKit/AMapNaviKit.h>



NS_ASSUME_NONNULL_BEGIN

@interface TT_GDMapManager : NSObject

//主地图
@property (nonatomic, strong) MAMapView *mapView;

//定位 manager
@property (nonatomic, strong) AMapLocationManager *locationManager;


//搜索
@property (nonatomic, strong) AMapSearchAPI *searchApi;

//经纬度转地址打开，移动地图中心会得到编码得来的地址
@property (nonatomic, assign) BOOL isRegeocodeSearchOpen;
//拿经纬度转地址信息的请求实体
@property (nonatomic, strong) AMapReGeocodeSearchRequest *regeoCodeSearchRequest;



//如果外部调用了获取经纬度  通过这个回调拿到经纬度
@property (nonatomic, copy) void(^getLocationCallBackBlock)(CLLocation *location, BOOL success, NSError *error);

@property (nonatomic, copy) void(^getCenterLocationCallBackBlock)(CLLocationCoordinate2D coordinate);

//如果外部调用了获取经纬度  通过这个回调拿到经纬度
@property (nonatomic, copy) void(^getReGeocodeSearchResponseCallBackBlock)(AMapReGeocodeSearchResponse *response);

//单例书写
+ (TT_GDMapManager *)shareMap;

- (void)initMapSDK;

#pragma mark -----地图相关
//添加地图，查看自己位置
- (void)mapView_loadWithContainerView:(UIView *)containerView;

//地图中心移动到某一点
- (void)mapView_moveMapCenterToLocation:(CLLocationCoordinate2D)coordinate;

//获取地图中心点位置
- (void)mapView_getMapCenterLocationComption:(void (^)(CLLocationCoordinate2D coordinate))comption;

//给地图放置大头针
- (void)mapView_addPointWithPointAnnotation:(MAPointAnnotation *)pointAnnotation;

//给地图添加海量的点
- (void)mapView_setManyPointWithArray:(NSMutableArray <MAMultiPointItem *>*)items;


#pragma mark -----定位相关
//获取当前定位位置
- (void)location_getCurrentLocationComption:(void (^)(CLLocation *location, BOOL success, NSError *error))comption;


#pragma mark -----经纬度 解析相关
//请求经纬度解析
- (void)regeo_requestReGeocodeSearchWithCoordinate:(CLLocationCoordinate2D)coordinate;

//根据经纬度，转换出详细地址信息  也可解析成周边的地点的pio数据
- (void)regeo_getAddressWithCoordinate:(CLLocationCoordinate2D)coordinate comption:(void (^)(AMapReGeocodeSearchResponse *response))comption;

@end

NS_ASSUME_NONNULL_END
